constraints solver: Avoid critials
authorMatthias Clasen <mclasen@redhat.com>
Thu, 27 Jun 2019 01:43:47 +0000 (01:43 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Sun, 30 Jun 2019 22:42:44 +0000 (23:42 +0100)
When the solver is finalized with existing
constraints, we end up with criticals when
the constraints ref finalize code calls
back into the hash table. Avoid that by
emptying the hash table beforehand.

gtk/gtkconstraintsolver.c

index 0441ca5e95be42ba7a4458a6d7c8674701191dc5..22fa0111a4ccc6c21571b9f181c1be4ee2c5fdf4 100644 (file)
@@ -265,6 +265,7 @@ gtk_constraint_solver_finalize (GObject *gobject)
 {
   GtkConstraintSolver *self = GTK_CONSTRAINT_SOLVER (gobject);
 
+  g_hash_table_remove_all (self->constraints);
   g_clear_pointer (&self->constraints, g_hash_table_unref);
 
   g_clear_pointer (&self->stay_error_vars, g_ptr_array_unref);